import request from '@/config/axios'

export interface AuthAddrVo {
  authType: number
  userType: number
  authUserId: number
  authUserName: string
  authAddrIds: number[]
}

// 创建地址授权
export const createAuthAddr = async (data: AuthAddrVo) => {
  return await request.post({
    url: '/zwsj/auth-addr/create',
    data: data
  })
}

// 删除地址授权
export const deleteAuthAddr = async (id: number) => {
  return await request.delete({
    url: '/zwsj/auth-addr/delete?id=' + id
  })
}

// 获得地址授权分页
export const getAuthAddrPage = async (params: any) => {
  return await request.get({
    url: '/zwsj/auth-addr/page',
    params: params
  })
}

// 根据授权方式返回地址列表
export const getAuthAddrPageByAuthType = async (params: any) => {
  return await request.get({
    url: '/zwsj/auth-addr/page/byauthtype',
    params: params
  })
}
